/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include <Config.h>
#include <filesystem/String.hpp>
#include <noise/hard/Channel.h>
#include <NoCopy.h>
#include <boost/scoped_ptr.hpp>

namespace liba {
namespace noise {

class MusicChanger : private Nocopy
{
	boost::scoped_ptr<noise::hard::Channel> channel;
	filesystem::String music_name;
	filesystem::String next_music_name;
	const double fadeout_speed;
	double global_volume;
	double current_volume;
public:
	explicit MusicChanger(double fadeout_time);
	void change_music(const filesystem::String & next_music);
	void LifeCycle(time_float delta_time);
	noise::hard::Channel * get_channel()const
	{
		return channel.get();
	}
	double get_volume()const
	{
		return global_volume;
	}
	void change_volume(double volume);
};

} // namespace noise
} // namesapce liba
using namespace liba;
